<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%spu_has_keywords}}".
 *
 * @property int $id
 * @property int $spu_id
 * @property int $search_keyword_id
 * @property int $created_at
 * @property int $updated_at
 */
class SpuHasKeywords extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%spu_has_keywords}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['spu_id', 'search_keyword_id', 'created_at', 'updated_at'], 'trim'],
            [['spu_id', 'search_keyword_id', 'created_at', 'updated_at'], 'required'],
            [['spu_id', 'search_keyword_id', 'created_at', 'updated_at'], 'integer'],
            [['spu_id', 'search_keyword_id'], 'unique', 'targetAttribute' => ['spu_id', 'search_keyword_id']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'spu_id' => Yii::t('app', 'Spu ID'),
            'search_keyword_id' => Yii::t('app', 'Search Keyword ID'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }
}
